{% extends 'base.html' %}
{% load static %}

{% block extra_css %}
<link rel="stylesheet" href="{% static 'css/user_posts.css' %}">
{% endblock %}

{% block content %}
<div class="checklist">
    <ul>
        {% for post in posts %}
            <li>
                <a href="{% url 'forum:post_detail' post.pk %}">{{ post.title }}</a>
                <form action="{% url 'forum:delete_post' post.pk %}" method="post" class="delete_btn">
                    {% csrf_token %}
                    <button type="submit">删除</button>
                </form>
            </li>
        {% empty %}
            <p>你还没有发布过帖子。</p>
        {% endfor %}
    </ul>
</div>
{% endblock %}